package flex.cc.order.manage.enums;

import com.google.common.collect.Lists;
import com.google.common.collect.Maps;

import java.util.List;
import java.util.Map;

/**
*
* @author WANGCONG
* 2021年9月18日下午12:20:56
* @desc 服务项目对应关系
*/

public enum OrderServiceEnum {
	
    ONE("FSG001", "搭电服务"),
    TWO("FSG002", "换胎服务"),
    THREE("FSG003", "现场快修"),
	FOUR("FSG004", "送水服务"),
	FIVE("FSG005", "拖车服务"),
	SIX("FSG006", "困境救援"),
	SEVEN("FSG007", "送防冻液服务"),
	EIGHT("FSG008", "送备用钥匙服务"),
    NINE("FSG009", "城市住宿关怀"),
	TEN("FSG010", "轮胎充气"),
    ELEVEN("FSG011", "城市涉水拖车");
	
    String type;
    String name;

    OrderServiceEnum(String type, String name) {
        this.type = type;
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public String getName() {
        return name;
    }

    public static String getName(String type) {
        for (OrderServiceEnum ele : OrderServiceEnum.values()) {
            if (type.equals(ele.getType())) {
                return ele.getName();
            }
        }
        return "";
    }

    public static OrderServiceEnum getEnum(String type) {
        for (OrderServiceEnum ele : OrderServiceEnum.values()) {
            if (type.equals(ele.getType())) {
                return ele;
            }
        }
		return null;
    }

    public static List<Map<String, Object>> getList() {
        List<Map<String, Object>> list = Lists.newArrayList();
        for (OrderServiceEnum ele : OrderServiceEnum.values()) {
            Map<String, Object> map = Maps.newHashMap();
            map.put("key", ele.getType());
            map.put("value", ele.getName());
            list.add(map);
        }
        return list;
    }
}
